#include "sdl.h"


void pause ()
{
    int continuer = 1;
    SDL_Event event;

    while (continuer)
    {
        SDL_WaitEvent(&event);
        switch(event.type)
        {
            case SDL_QUIT:continuer = 0;
        }
    }
}

/**fonction affichage ecran**/


void sdlInit(image* ecran, image* fond)
{
    SDL_Rect positionFond;

    SDL_Init(SDL_INIT_VIDEO);

    *ecran=SDL_SetVideoMode(800, 480, 32, SDL_HWSURFACE);
    SDL_WM_SetCaption("chargement d'image en SDL", NULL);

    positionFond.x=0;
    positionFond.y=0;

    *fond=SDL_LoadBMP("media/fond2.bmp");
    SDL_BlitSurface(*fond,NULL,*ecran,&positionFond);

}


int sdlQuit(image *ecran, image* fond)
{
    SDL_FreeSurface(*fond);
    SDL_Quit();
    return EXIT_SUCCESS;
}



